<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>

	<ul id="ul1">
		<li></li>
		<li></li>
		<li></li>
	</ul>
	<script>
		window.onload = function(){
			var oUl = document.getElementById("ul1")
			var i =0

			for(i=0;i<oUl.childNodes.length;i++){
				if(oUl.childNodes[i].nodeType == 1){
					
				oUl.childNodes[i].style.background="red"
				}
			}

		}
	</script>
</body>
</html>

// nodeType：3代表文本节点，1代表元素节点
